package com.lzq.model.singleton;

/**
 * @author : modify
 * @version : v1.0
 * @description :
 * @createTime : 2022/11/13 16:35
 * @updateUser : modify
 * @updateTime : 2022/11/13 16:35
 * @updateRemark :
 */
public class HungryStyleFunc {
    /**
     * 静态成员变量
     */
    private static HungryStyleFunc hungryStyleFunc;

    static {
        hungryStyleFunc = new HungryStyleFunc();
    }

    private HungryStyleFunc() {
    }

    public static HungryStyleFunc getInstance() {
        return hungryStyleFunc;
    }
}

class TestFunc {
    public static void main(String[] args) {
        HungryStyleFunc instance = HungryStyleFunc.getInstance();
        HungryStyleFunc instance1 = HungryStyleFunc.getInstance();
        System.out.println(instance == instance1);
    }
}